using UnityEngine;
using System.Collections;

public class BM_LevelObject : MonoBehaviour
{
	#region Members
	
	protected BM_MessageHandler	m_rMessageHandler = null;
	protected BM_FSM			m_rFSM = null;
	
	protected GameObject		m_rSceneManager = null;
	
	#endregion
	
	
	#region Properties
	
	public BM_MessageHandler MessageHandler
	{
		get { return m_rMessageHandler; }
	}
	
	#endregion
	
	public virtual void Awake()
	{
		m_rMessageHandler = new BM_MessageHandler();
		m_rFSM = new BM_FSM();
		
		m_rSceneManager = BM_Utils.FindObjectInScene_ByTag(BM_Common.GetLabelName(StringLabel.LABEL_TAG_SCENEMANAGER));		
	}
	
	public virtual void Start() { }
	
	public virtual void OnDestroy()
	{
		m_rMessageHandler.RemoveFromDispatcher();
	}
	
	public virtual void Update()
	{
		m_rFSM.UpdateFSM();
	}
}
